Added hierarchical json flattening of associated models