Where to put code that customizes API
I am building a native mobile app where I need to display categories of products in different screens, and my client uses Wordpress as their CMS. I see that in order to return images from a gallery, I will need to use get_post_galleries() or get_post_gallery() per the instructions here:
How to get the attached gallery in the rest API?
My question is, to which file do I add the custom endpoints? So far my CMS is very bare bones so for the purposes of this question, you can assume I only have the files included with a new Wordpress installation.