Added handling of other http codes in Route function