Tiny changes to api.js