Fix code responsible for reusing already resolved endpoints.
Use http agent and introduce replay of http errors on network failure.