Add support for error response in JSON format