Added HTTP code checking