added regex handling to routes