It might be hard to troubleshoot this without seeing what you are seeing, but maybe this might help resolve some issues or point you in the right direction.
In the settings tab for the API Designer's endpoint there is a code environment section. Perhaps you can adjust and play around with this setting to get it to work properly. Here is a picture of what it looks like in DSS.
From the looks of the error message, it seems like there is some sort of a kernel error or exception that is happening when you try to run your query to test out your endpoint. If you happen to be using a code environment you defined for your endpoint is it possible there may be something wrong with the requirements?