Adds http status code 500 to error responses for ajax calls