Updated with new JS API calls