Fixed this template to use new-style database API.