Invert conditional to remove a level of indentation
The segment response callback was getting pretty deeply nested, so invert the readyState check and return early. Also added some comments.