api and database