Handle nested objects correctly

This is useful for things like a nested entity-reference that you want as 
a dict/json-object in the response.