Fixing issues with the javascript api