protected function createResponse(array $bundle, array $kwargs = array())
 {
     $contentType = $this->detectSupportedContentType($bundle['request']);
     $this->applySerializationOn($bundle, $contentType);
     $statusCode = getattr($kwargs['statusCode'], 200);
     $headers = getattr($kwargs['headers'], array());
     $content = getattr($bundle['data'], '');
     $response = new HttpResponse($statusCode, $content, $headers);
     $response->setContentType($contentType);
     return $response;
 }