Adding try/catch to db utils; internal refactor mongodb