if data is 'null' and success is true only send 'success'=>true
short function to echo error messages regarding the AJAX_REQUEST value added