new unit testing for http and small code fix