You don't need the metadata to add an study, neither the columns. This is something that the SampleTemplate and PrepTemplate objects will take care of. Remove all the code related to it