Fixed send() in api.js