The sendError method returns a JSON response with the data and status code. You should put 'return' in front of this and the other lines.