added comments to the js api