protected function isJson($string) {
        // json_decode a numeric string doesn't throw an error, so we have to check it manually
        if (! is_string($string) || is_numeric($string)) {
            return false;
        }
        $result = @json_decode($string);
        return (json_last_error() == JSON_ERROR_NONE);
    }