update router error and notfound handling functionality