Execute a callback when a request closes, finishes, or errors