Created error checking for bad routes