better passthrough of error messages, plus test
DRY up HTTP request/error handling
remove dead code