adding functionality to API and JS interface