added database persistence and remote data loading