return ErrorReponse when request contains invalid JSON or HTTP method