Add java client code from CM 4.6
[py] Update Python client to be compatible with API v4 (CM 4.6)