Throw exceptions on erroneous status codes

This patch aims to additional exception checking
on receiving other erroneous status codes apart from
400 and 404.

Change-Id: I184c2c0627c457d9c49a84e9e8313a0c88617ec1