modified db_handler to use query mongodb isntead of sql