utility method for REST invocation