changes to api.js