Cleaned api.js