error: use application/json as the content-type

Fixes #1584
Merge pull request #1591 from philips/application-json-errors

error: use application/json as the content-type