Yeah, on second thought, this code could use a rewrite. First off, I don't think we need to worry about checking to make sure notify is a function. It seems unlikely that anyone would try to put anything else in there. Moreover, we still want to do the central error handling. Just putting
notify && notify(response)
lower down would be better.