add client side error handling for unauthorized ajax calls