improved getHost and getPath methods for route