refactored routes to 4.x style & added ENV varible dependent includes