Safeguarded this code from Fatal Error - Undefined offset 1.

In some scenarios of bad or intermittent internet connectivity this will happen. I was unable to debug the code at a moment of time that caused the error in order to better understand the content of response but this at least seems a sufficient safety check to have in place.
Merge pull request #18 from gmoreira/master

Fatal Error: Undefined offset 1