api.js implemented