example for how a js api could look like