Fixing json null pointer issue for bad responses