       exportObject[col] = yield collections[col].find().lean().exec()
       for doc in exportObject[col]
         if doc._id
-          doc = exports.removeProperties doc
+          doc = removeProperties doc
 
     this.body = [exportObject]
     this.status = 200



# Build response object
exports.buildResponseObject = (model, doc, status, message, uid) ->
  return {
    model: model
    record: doc

    if (prop == propertyID || prop == propertyV)
      delete obj[prop]
    else if ( typeof obj[prop] == 'object' || obj[prop] instanceof Array )
      removeProperties(obj[prop])
  return obj


# Function to return unique identifier key and value for a collection
getUniqueIdentifierForCollection = (collection, doc) ->
  switch collection
    when 'Channels' then uidKey = 'name'; uid = doc.name
    when 'Clients' then uidKey = 'clientID'; uid = doc.clientID
