Changed database connection to new API