database connection api