       return errorResult
 
     completionHandler = (entity) ->
+      console.log "In completion handler"
       entityParser = entityHelper environmentId
 
       responseCallback = callback


    domainBoundOperationHandler = taskDomain.bind operationHandler


    domainBoundOperationHandler task.request, completionHandler

  obj =

    return completionHandler

  process = (task, modules, callback) ->
    console.log "Processing entry"
    console.log task
    unless task.collectionName?
      return callback new Error "CollectionName not found"

    collectionToProcess = collection task.collectionName
    dataOp = ''
    console.log "Generating completion handler"
    completionHandler = initCompletionHandler task

    console.log "Checking dataop"
    if task.method is 'POST'
      console.log "DataOp is insert"
      dataOp = 'onInsert'
    else if task.method is 'PUT'
      console.log "DataOp is update"
      dataOp = 'onUpdate'
    else if task.method is 'GET' and task.endpoint isnt '_count'
      console.log "DataOp is GET"
      if task.entityId?
        console.log "GetById"
        dataOp = 'onGetById'
      else if task.query?
        console.log "getByQuery"
        dataOp = 'onGetByQuery'
      else
        console.log "GetAll"
        dataOp = 'onGetAll'
    else if task.method is 'GET' and task.endpoint is '_count'
      if task.query?
