wrap database operation with clear interface, include database unit tests