Updated http client based functionality in order to close connections.