Java client to web api