 _ = require("underscore")
 
 module.exports = class Router
-	constructor: (webRouter, apiRouter, publicApiRouter)->
+	constructor: (webRouter, privateApiRouter, publicApiRouter)->
 		if !Settings.allowPublicAccess
 			webRouter.all '*', AuthenticationController.requireGlobalLogin
 

		AuthenticationController.addEndpointToLoginWhitelist '/register'


		EditorRouter.apply(webRouter, apiRouter)
		CollaboratorsRouter.apply(webRouter, apiRouter)
		SubscriptionRouter.apply(webRouter, apiRouter)
		UploadsRouter.apply(webRouter, apiRouter)
		PasswordResetRouter.apply(webRouter, apiRouter)
		StaticPagesRouter.apply(webRouter, apiRouter)
		RealTimeProxyRouter.apply(webRouter, apiRouter)
		ContactRouter.apply(webRouter, apiRouter)
		AnalyticsRouter.apply(webRouter, apiRouter)

		Modules.applyRouter(webRouter, apiRouter, publicApiRouter)


		if Settings.enableSubscriptions

			require("./models/Project").Project.findOne {}, () ->
				throw new Error("Test error")

		privateApiRouter.get '/opps-small', (req, res, next)->
			logger.err "test error occured"
			res.send()

