updated tests to use JS API