Fixed api.js