                                 user.friends.push {_id : docs[0]._id, name : param.name}
                                 Db.update 'user', user._id, user, () =>
                                     res.send 200 # Change to render a proper page TODO
+                            else
+                                res.send 400
                     else
                         res.send 400 # Change to render a proper page TODO
         else

        '/user/mail/:id'        : exports.User.updateUserMail
        '/user/password/:id'    : exports.User.updateUserPassword

    delete :
        '/user/friend'  : exports.User.deleteFriend
                if docs.length == 0
                    res.send 400 # Change to render a proper page TODO
                else
                    if param._id? and docs[0].registered is true
                        Db.get 'user', param._id, (user) =>
                            if !user?
                                res.send 400 # Change to render a proper page TODO
                            else if user.name isnt docs[0].name
                                if !user.friends?
                                    user.friends = []
                                else
