Changed API workflow in router.js