Element API with multiple categories gives back error 500
You may want to try further limiting what you're returning from the API call. 

The server may just have a low PHP memory size limit set. There are many answers to fix the PHP memory size bytes exhaustion error. Here's a few:


https://stackoverflow.com/questions/415801/allowed-memory-size-of-33554432-bytes-exhausted-tried-to-allocate-43148176-byte
https://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter-xml


That is a PHP ini setting. If you don't have access to the php.ini file, you have to call ini_set()
 somewhere in your source code. 

This statement sets no memory limit, although I do not recommend using this: ini_set('memory_limit','-1');

Try the lowest amount that you can afford before deploying application, as this can cause server issues if too much memory is allocated to by a bad PHP script.