Updates to api.js