Changed to API for DB access