determine structure of returned object