Fixed errors in index.js route