Added error checking to http.c
Fixed minor bug in http.c
Added debug