Update libs/api.js