Adding API calls example to java clode