Added separate API for database communication