Cleaning up json handling for post and put.