Update index.js

replace www with api