Move resp.Body.Close() statement after the error has been checked, or could cause panic