converted router.coffee to router.js