Java RESTful practice