expose a js api