Switch routes so hierarchy is checked before id