dumps errors as valid JSON

  when status code is != 200
  when response has invalid JSON