add api for database