Finished database api