better path building for endpoints