Fixed a bug trying to process empty response data. Now it gracefully handles it and returns an error to the caller.