Extra JavaScript API and tests