dumps errors as valid JSON

  when status code is != 200
  when response has invalid JSON
fix json example syntax
Merge pull request #1 from ober/marcosvm/jsonerror

dumps errors as valid JSON