Serialize form to JSON