Added more test cases for database functions, code coverage to 100%