Added failure response json
allow form to be resubmitted after ajax is done
Updated comment
Added code to swap content on form submit