Updated form handler

- Checking on the 'data' variable returned by success/failure functions
of ajax post method