Avoiding NullReference Exceptions.

Wrapping the response object in null checks.
Merge pull request #49 from ajjohnston/master

Avoiding NullReference Exceptions.