preparing RESTful json functionality