Fix response code on API endpoints