Extensive notes added to api.js.