Fix typos with JavaScript api