             CleanData ret
 
             res.setHeader 'Content-Type', 'application/json'
-            res.status(200).send ret
+            res.status(200).send JSON.stringify ret, null, '   '
 
 module.exports.import = (req, res) ->
     if not req.body.all?
          return h.sendErr res, "missing parameter all", 400, "missing parameter 'all' in the file"
 
     all = req.body.all
-    all.accesses   ?= []
-    all.accounts   ?= []
-    all.categories ?= []
-    all.operations ?= []
-    all.settings   ?= []
+    all.accesses       ?= []
+    all.accounts       ?= []
+    all.categories     ?= []
+    all.operationtypes ?= []
+    all.operations     ?= []
+    all.settings       ?= []
 
     accessMap = {}
     importAccess = (access, cb) ->

                if err?
                    return h.sendErr res, "When creating category: #{err.toString()}"

                async.eachSeries all.operations, importOperation, (err) ->
                    if err?
                        return h.sendErr res, "When creating operation: #{err.toString()}"

                    async.each all.settings, importSetting, (err) ->
                        if err?
                            return h.sendErr res, "When creating setting: #{err.toString()}"

                        log.info "Import finished with success!"
                        res.sendStatus 200


            categoryMap[catId] = created.id
            cb null, created

    opTypeMap = {}
    importOperationType = (type, cb) ->
        opTypeId = type.id
        type.id = undefined
        OperationType.create type, (err, created) ->
            if err?
                return cb err
            opTypeMap[opTypeId] = created.id
            cb null, created

    importOperation = (op, cb) ->
        if op.categoryId?
            if not categoryMap[op.categoryId]?
                return h.sendErr res, "unknown category #{op.categoryId}", 400, "unknown category"
            op.categoryId = categoryMap[op.categoryId]

        if op.operationTypeID?
            if not opTypeMap[op.operationTypeID]?
                return h.sendErr res, "unknown operation type #{op.operationTypeID}", 400, "unknown operation type"
            op.operationTypeID = opTypeMap[op.operationTypeID]

        Operation.create op, cb

    importSetting = Config.create.bind Config

    log.info """Importing:
    accesses:        #{all.accesses.length}
    accounts:        #{all.accounts.length}
    categories:      #{all.categories.length}
    operation-types: #{all.operationtypes.length}
    operations:      #{all.operations.length}
    settings:        #{all.settings.length}
    """

    async.each all.accesses, importAccess, (err) ->
