Modify test_db_api to fix failed db unit tests