Fixed issue with api.js