completes mongoDB integration