Check if the supplied data is a dict or json and treat it as such