api between client and database