Generate JSON from a form and fill the form from a JSON