Avoiding NullReference Exceptions.

Wrapping the response object in null checks.