Adding remote api support for java

Why POST twice?