Modified web.js to fetch from index