updated JavaScript API to use argv