Add form validation in api.php
and send mail and sms functionality in api.php