Ajax & server side validation for Angularjs