 ## function init (callback)
 ## @callback {function} Continuation to pass control back to when complete.
 ## Initialize request
-module.exports.init = (callback) =>
+module.exports.init = (callback) ->
     removeEmptyView = (doc, callback) ->
-        if Object.keys(doc.views).length is 0 or not doc?.views?
+        if not doc?.views? or Object.keys(doc.views).length is 0
             db.remove doc._id, doc._rev, (err, response) ->
                 if err
                     log.error "[Definition] err: " + err.message

## function recoverApp (callback)
## @callback {function} Continuation to pass control back to when complete.
## Callback all application names from database
recoverApp = (callback) =>
    apps = []
    db.view 'application/all', (err, res) =>
        if err
            callback err
        else if not res
            callback null, []
        else
            res.forEach (app) =>
                apps.push app.name
            callback null, apps


                    }
                }
                """
        # Useful to manage application access
        application:
            all:
                map: """
                function(doc) {
                    if(doc.docType &&
                            doc.docType.toLowerCase() === "application") {
                        return emit(doc._id, doc);
                    }
                }
