move controller/index.js to main.js