       json: (req, res) ->
         res.send options.toJSON req[options.urlName], req
       default: exports.contentNegotiator
+
+  resource.base = options.base if options.base
+  resource

    load: (request, where, callback) ->
      whereQuery = {}
      whereQuery[options.where] = where
      seek request, whereQuery, (err, items) ->
        return callback err if err
        callback null, items[0]

    index:
      html: (req, res) ->
        seek req, {}, (err, items) ->
          if options.addPlaceholderForEmpty and items.length is 0
            blankItem = {}
            for property, defs of options.schema.definitions[options.name].properties

      , (err, items) ->
        items = [] unless items
        callback err, items
      return

    if constraints.id
      options.model.find constraints.id, (err, item) ->
        callback err, [item]
      return

    options.model.all
