seperate validating function to validation.js; remove batchUpdate functions
move use strict into function
tidy code
remove checkUnique function in js, pending to do that in server side