added database, router and appState