Simplified index.js greatly by using request instead of http