inital commit for $http stuff
consolidated repeated code