adding keep-alive since we'll want it in some scenarios and doesn't hurt in others, and adding handling of all error codes