             return res.status(404).send(error: "Model not found with id: #{req.query.id}")
           else
             res.json(json)
-        return res.json(json) unless @render
 
-        # TODO: intgrate the cache -> would need to be done as part of the fetch
         if req.query.$page
           @render req, json.rows, (err, rendered_json) =>
             return res.status(500).send(error: err.toString()) if err

        return res.status(404).send(error: err.toString()) if err
        return res.status(404).send(error: "Model not found with id: #{req.params.id}") unless json
        json = _.pick(json, @white_lists.show) if @white_lists.show
        return res.json(json) unless @render

        # TODO: intgrate the cache -> would need to be done as part of the fetch
        @render req, json, (err, json) =>
          return res.status(500).send(error: err.toString()) if err
          res.json(json)

  constructor: (app, options={}) ->
    @[key] = value for key, value of options
    @white_lists or= {}
    @views or= {}

    if @auth
      app.get "#{@route}/:id", @auth, @show
