added database support, updated index.html