Fix HTTP POST error handling and correct typos

Currently, when the POST fails, `(response, err)` is set to `(nil, <some err>)`. We need to return on err before running `response.Body.Close()`, else it panic()s.