I note that POST and PUT code is virtually identical. I wonder if you might consolidate into one method the common logic?