Added API for cancelling operations that are currently running. Fixed an issue which was causing a dead lock (while waitUntilAllOperationsAreFinished is being executed).