add matchRoute back, fix insertRoute, add tests