finished implementing http client (need some corrections)