defining the JS API