     
     ///the actual task
     var task: NSURLSessionDataTask!
-    /// Reports if the task is currently running
-    private var running = false
-    /// Reports if the task is finished or not.
-    private var done = false
-    /// Reports if the task is cancelled
-    private var _cancelled = false
-    
+	
+	private enum State: Int, Comparable {
+		/// The initial state of an `Operation`.
+		case Initialized
+		
+		/**
+		The `Operation`'s conditions have all been satisfied, and it is ready
+		to execute.
+		*/
+		case Ready
+		
+		/// The `Operation` is executing.
+		case Executing
+		
+		/// The `Operation` has finished executing.
+		case Finished
+		
+		/// what state transitions are allowed
+		func canTransitionToState(target: State) -> Bool {
+			switch (self, target) {
+			case (.Initialized, .Ready):
+				return true
+			case (.Ready, .Executing):
+				return true
+			case (.Ready, .Finished):
+				return true
+			case (.Executing, .Finished):
+				return true
+			default:
+				return false
+			}
+		}
+	}
+	
+	/// Private storage for the `state` property that will be KVO observed. don't set directly!
+	private var _state = State.Initialized
+	
+	/// A lock to guard reads and writes to the `_state` property
+	private let stateLock = NSLock()
+	
+	// use the KVO mechanism to indicate that changes to "state" affect ready, executing, finished properties
+	class func keyPathsForValuesAffectingIsReady() -> Set<NSObject> {
+		return ["state"]
+	}
+	
+	class func keyPathsForValuesAffectingIsExecuting() -> Set<NSObject> {
+		return ["state"]
+	}
+	
+	class func keyPathsForValuesAffectingIsFinished() -> Set<NSObject> {
+		return ["state"]
+	}
+	
+	// threadsafe
+	private var state: State {
+		get {
+			return stateLock.withCriticalScope {
+				_state
+			}
+		}
+		set(newState) {
+			willChangeValueForKey("state")
+			stateLock.withCriticalScope { Void -> Void in
+				guard _state != .Finished else {
+					print("Invalid! - Attempted to back out of Finished State")
+					return
+				}
+				assert(_state.canTransitionToState(newState), "Performing invalid state transition.")
+				_state = newState
+			}
+			didChangeValueForKey("state")
+		}
+	}
+	
     /**
     creates a new HTTP request.
     */

    override public var asynchronous: Bool {
        return true
    }
    
    /// Returns if the task is current running.
    override public var executing: Bool {
        return running
    }
    
    /// Returns if the task is finished.
    override public var finished: Bool {
        return done && !_cancelled
    }
    
    /**
    start/sends the HTTP task with a completionHandler. Use this when *NOT* using an NSOperationQueue.

    Start the HTTP task. Make sure to set the onFinish closure before calling this to get a response.
    */
    override public func start() {
		if cancelled {
			state = .Finished
			return
		}
		
		state = .Executing
		task.resume()
    }
	
    /**
    Cancel the running task
    */
    override public func cancel() {
        task.cancel()
        finish()
    }
    /**
