accept statusCode as optional param to JSON::error