added JSON and REST support