Refactor mongodb api to reuse the Mongo Object to prevent too-many connection problem