Nested attributes for both multi resources and singular resources

This is still unstable and need to refactor the sql queries to achieve
desired results