added clause in raw response to raise an exception instead of crashing on empty array if nil response is operated on