Set up mongodb and query in homepage request