raising exception if route_id is not supplied to route
raising exceptions if route_id and pattern_id supplied to patterns are not Integers
better error handling and some refractoring