Update form handling to work with latest api changes.