Added JS API functions.