Ensure we always return a sane http response for API errors (500s)