     query[key] = value
 
     @findOne query, callback
-  
+
   findById = (id, systemId, callback) ->
     @findOneBy '_id', id, systemId, callback
 

  update: update
  destroy: destroy
  name: Resource.modelName
  count: count
              #safe because max >= 1
              pageCount = Math.ceil(count/max) or 0
              callback(null, results, pageCount) if callback

  findOne = (query, callback) ->
    if not query? or not query.systemId?
      callback 'Cannot find ' +
