allow data to be passed into marshal as a dict or an object