You may need to dig into how did you implement your API on apache,? there is any configuration missing between Apache and OLS?
On backend, you may need to investigate which what the API call to and where it fails. or Enable debug log for your code and check it for details.