Complete database system. Refactoring frontend-back end interaction.