updates to support javascript API