using JS use api rather than a Java object