protected function respondWithModels(ResultsetInterface $models)
  {

    if (count($models) == 0)
    {
      $this->response->data = [];
    }
    else
    {
      foreach ($models as $model)
      {
        $this->response->data[] = (object)$model->toArray();
      }
      $this->response->getMeta()->count = count($models);
    }

    return $this->response;
  }