         if item[ key ] is value
           return item
       )
-    return collection
+    collection
 
   @_filterExtended: ( collection, filters ) ->
     collection = _.filter( collection, (item) ->


      return
    )
    return collection

  

    if params.order
      all_complied = @_order( all_complied, params.order )

    all_complied

  @_sortBy: ( collection, attribute ) ->
    _.sortBy( collection, (item) ->

      # set displayName as default sort attribute
      if !attribute
        attribute = 'displayName'

      # check if displayName exists
      if attribute is 'displayName' && item.displayName
        return item.displayName().toLowerCase()
      else
        attribute = 'name'

      return '' if item[ attribute ] is undefined
      return '' if item[ attribute ] is null

      # return value
      item[ attribute ].toLowerCase()
    )

  @_order: ( collection, attribute ) ->
    if attribute is 'DESC'
      return collection.reverse()
    collection

  @_filter: ( collection, filter ) ->
    for key, value of filter
