flattens JSON object with multi-nested attributes into single level.