public function index($id = null)
    {
        // Support for resource/identifier/resource
        if ($id != null) {
            return $this->getById($id);
        }

        //parse the rquest
        $parse = new QueryParser($this->request->getQuery());
        $params = $parse->request();

        $results = $this->model->find($params);

        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');

            $results = QueryParser::parseRelationShips($relationships, $results);
        }

        //this means the want the response in a vuejs format
        if ($this->request->hasQuery('format')) {
            unset($params['limit'], $params['offset']);

            $results = [
                'data' => $results,
                'limit' => $this->request->getQuery('limit', 'int'),
                'page' => $this->request->getQuery('page', 'int'),
                'total_pages' => ceil($this->model->count($params) / $this->request->getQuery('limit', 'int')),
            ];
        }

        return $this->response($results);
    }