refactored for httprequests.

this is to refactor so that httprequest is independent of the tasks. Also modified the JSON objects for the httprequest.