adding apache http client
refactoring some code.