Form validation and serialisation