working API for database managemnt