implemented condition for when a route is not found, and refactored some to accomodate for string result type instead of int