Moved all the common code for POST and PUT into one function. I'm wondering if this should really get pushed into the model?