Improved JavaScript API