Implement validate in server and browser