some refactoring

* only one cherrypy.expose is enough
* pass a dict to the web-exposed method
* convert to json in the web-exposed method
* use exceptions
* remove unused paths