[database] implement search
[database] remove users from database when they are disconnected and their room is closed