Fixing api.js