 		# Log access
 		@app.use accessLogger
 		@app.use accessLoggerDev
-		for controller in [
-				'header'
-				'restful'
-				'schemo'
-				'upload'
-				'execute'
-				'monitor'
-				'ldf'
-				'swagger'
-				'json-import'
-				'syntax-highlight'
-				'play'
-			]
-			do (controller) =>
-				log.info "Setting up route #{controller}"
-				require("./routes/#{controller}")(@app)
-		# root route
-		@app.get '/', (req, res, next) ->
-			res.status 302
-			res.header 'Location', 'http://infolis.github.io'
-			res.end()
-		# Error handler
-		@app.use errorHandler
-		@app.use notFoundHandler
+		controlers = [
+			'header'
+			'restful'
+			'schemo'
+			'upload'
+			'execute'
+			'monitor'
+			'ldf'
+			'swagger'
+			'json-import'
+			'syntax-highlight'
+			'play'
+		]
+		Async.eachSeries controlers, (controller, done) =>
+			log.info "Setting up route #{controller}"
+			done null, require("./routes/#{controller}")(@app)
+		, (err, next) =>
+			# root route
+			@app.get '/', (req, res, next) ->
+				res.status 302
+				res.header 'Location', 'http://infolis.github.io'
+				res.end()
+			# Error handler
+			@app.use errorHandler
+			# 404 handler
+			@app.use notFoundHandler
 
 	startServer : () ->
 		log.info "Setting up routes"


log = require('./log')(module)

errorHandler = (err, req, res, next) ->
	if typeof err is 'string'
		err = {'message': err}

		return res.render 'error', { err }
	else
		res.send StringifySafe err, null, 2

accessLogger = Morgan 'combined', stream: Fs.createWriteStream(__dirname + '/../data/logs/access.log', {flags: 'a'})
accessLoggerDev = Morgan 'dev'
