Added HTTP error handling. Not quite ready for prime time.