$data = json_encode( array('type'=>$type,'params'=>$params) );<br>
$headers = array( 'Content-type' => 'application-json; charset=utf8' );<br>
$responce = new \Symfony\Component\HttpFoundation\Response( $data, 200, $headers );<br>
return $responce;<br>