             db.save "_design/#{params.type}", design_doc, (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, 200
 
         else if err
-            send error: true, msg: err.message, 500
+            send error: err.message, 500
 
         else
             views = res.views

                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
                    else
                        send success: true, 200


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

