updated form validation, added json dumps instead of rendering