Unit tests for database apis