Update router.js

updated query param fetching logic