added test for reponse existence and parse that response only if it is an object