Correctly handle route templates