small refactoring
redirect to the query page instead of the login page
switch to newer MongoClient class