                     db.merge "_design/#{params.type}", {views:views}, (err, res) ->
                         if err
                             console.log "[Definition] err: " + JSON.stringify err
-                            send error: true, msg: err.message, 500
+                            send error: err.message, 500
                         else
                             send success: true, 204

    removeAllDocs = (res) ->
        async.forEachSeries res, removeFunc, (err) ->
            if err
                send error: true, msg: err.message, 500
            else
                delFunc()


        if err and err.error is 'not_found'
            send error: "not found", 404
        else if err
            send error: err.message, 500
        else
            views = res.views
            request.get @appName, params, (path) =>
