API:Validatepassword/Sample code 1