Connect new db schema to programming interfaces.
Update test data and fix record sorting.