Removing usage of json_last_error() to maintain PHP 5.2 support.