added error handling and notfound routes