JSON.parse fix if server responds with 500 and HTML instead of JSON

Fixed so if server responds with HTTP 500 and HTML instead of JSON that node.js does not throw Error while trying to parse response JSON