added router request handlers and test and began refactoring router.js