Also, I'm seeing a bunch of repetition here - the body values for create and update are identical, the contents of the '$' field are identical everywhere. Extract methods to build these and remove duplication.