Adding more database functions and testcases