protected function sendErrorResponse($status, $messages = array()) { $body = '<Failure><Errors><Error>' . implode('</Error><Error>', $messages) . '</Error></Errors></Failure>'; $this->sendResponse($status, $body); }