reworked http sample to be async using promises