     prefix: 'Cozy DB'
 
 fs = require 'fs'
+path = require 'path'
 async = require 'async'
 
 # Public: the Model constructor

    models = []

    # get all indexes defined in models into an array
    for file in fs.readdirSync modelPath
        try
            model = require modelPath + file
            if model?.prototype instanceof CozyModel
                models.push model

    # get all requests from the request file into an array
    for docType, requestDefinitions of requests
        model = require modelPath + docType

        for requestName, requestDefinition of requestDefinitions
            requestsToSave.push {model, requestName, requestDefinition}

            options.dbName ?= process.env.POUCHDB_NAME or 'cozy'
            PouchModel.db = new Pouch options.dbName

getRequests = (modelsPath) ->
    requestFile = path.join(modelsPath, "requests")
    # get the requests file
    try requests = require requestFile
    catch err
