modularized FE js code and added more ajax validations for users/new