added Error callback for AJAX request from device