added java version of api