Use endpoints when calculating the route path