Added exception for null entity

Summary: Throw IOException when entity from response
is null.

Change-Id: Iac00366701cd95e0db7764061497f1181e27193e