Added more db operations and utility functions. Added matching tests