Fix PHP warning.
Convert old API to use the new database.