Form validation and Check duplicate names. TODO: write server side on duplicate