simplify JS API (now matches readme)