Solution:
Try to make a page api and make the api.php a template. Try to access it from there, I’m not sure if any of your plugins refuse access to the wp-content/themes or what but my api is a template on a page 🙂