Factor out the post json building logic

also force a particular json so we can compare the form input and output