How do I check whether a request has completed or cancel a pending request?