           @load( data )
 
   reset: (params) ->
+    if !App[ params.type ]
+      @log 'Collection', 'error', 'reset', 'no such collection', params
+      return
     @log 'Collection', 'debug', 'reset', params
 
     # empty in-memory

    App[type].deleteAll()

  findByAttribute: ( type, key, value ) ->
    App[type].findByAttribute( key, value )

  count: ( type ) ->
    App[type].count()

  fetch: ( type ) ->
    App[type].fetch()

  _sortBy: ( collection, attribute ) ->

      return data

  get: (params) ->
    if !App[ params.type ]
      @log 'Collection', 'error', 'get', 'no such collection', params
      return

    @log 'Collection', 'debug', 'get', params
    App[ params.type ].refresh( object, options: { clear: true } )

  all: (params) ->
    if !App[ params.type ]
      @log 'Collection', 'error', 'all', 'no such collection', params
      return

    all = App[ params.type ].all()
    all_complied = []
    for item in all
