             permission doc.docType, () =>
                 indexDoc(doc)
         else
-            send 404
+            send error: "not found", 404
 
 
 # POST /data/search/

action 'removeAll', ->
    client.del "clear-all/", (err, res, resbody) ->
        if err
            send 500
        else
            send {success: true, msg: resbody}, res.statusCode
    , false  # body is not JSON

            fields: body.fields
        client.post "index/", data, (err, res, resbody) ->
            if err or res.statusCode != 200
                send error: JSON.stringify err, 500
            else
                send success: true, 200
        , false # body = indexation succeeds, do not parse

    db.get params.id, (err, doc) ->
