code: protected function createApiResponse($data , $statusCode = 200)
      {
          $json = $this->serialize($data);
  
          return new Response($json , $statusCode , [
              'Content-Type' => 'application/json' ,
          ]);
      }
docs: @param     $data
  @param int $statusCode
  
  @return Response
  @throws \InvalidArgumentException