def METHOD_NAME(self, kwargs):
    data = kwargs.get("data", None)
    if not data:
        data = kwargs["data"] = {}
    elif type(data) != dict and type(data) != str:
        raise JsonApiError(
            f"incorrect type for keyword 'data' MUST be Dictionary or String: {data}"
        )
    if "json" in kwargs and kwargs["json"]:
        return json.dumps(kwargs["data"])
    else:
        return kwargs["data"]