     
     func unregisterRequest(request: Request) {
         registeredRequests[request.tag] = nil
+    }
+    
+    // MARK: - NSURLSessionDelegate
+    public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
+        backgroundSessionCompletionHandler?()
+        backgroundSessionCompletionHandler = nil
     }
     
     // MARK: - NSURLSessionDataDelegate

    }
    
    private var registeredRequests = [String: Request]()
    
    lazy var session : NSURLSession = {
        let sessionConfig = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(NSBundle.mainBundle().bundleIdentifier!)

        }
    }
    
    // MARK: - Background Sessions
    public func setBackgroundSessionCompletionHandler(completionHandler: () -> Void, sessionIdentifier: String) {
        if session.configuration.identifier == sessionIdentifier {
            backgroundSessionCompletionHandler = completionHandler
        }
    }
    
    // MARK: - Request tracking
    func registerRequest(request: Request) {
        registeredRequests[request.tag] = request
