updated JS API to use argv instead of #