Changed the class structure for the application and modified the class methods for mongoDB functionality