There was a warning being generated in doRequest() because the array $args was not being checked before the foreach. Added checking.