Java Implementation of functionality to communicate with Restful servies