Ajax server-side validation and sending