Added unit test for db/api

Change-Id: Ibec0a3dfa253113728eb2b4df3690d16a3933f99