Throw newrelic error on HTTP 500

Newrelic sometimes throws HTTP 500 which is currently not handled.

This PR

* throws newrelic_down error on http 500
* refactors http request a little bit