refactor routes to routes/index.js and use JSONStream