Add database backend, and further progress with RESTful interface.