anchor.diff:      let addIndex (index : Index.Dto) (state : State.T) = 
           maybe { 
               do! index.Validate()
  -            do! state |> State.indexExists index.IndexName
  -            do! state |> loadIndex index
  -            return CreateResponse(index.IndexName)
  +            match state |> State.indexExists index.IndexName with
  +            | Choice1Of2(_) -> return! fail <| IndexAlreadyExists(index.IndexName)
  +            | _ -> 
  +                do! state |> loadIndex index
  +                return CreateResponse(index.IndexName)
           }
       
       /// Get index by name
  
positive.code:     type Service(state) = 
          do state |> loadAllIndex
          interface IIndexService with
              member __.IndexOnline(indexName : string) = failwith "Not implemented yet"
              member __.GetIndex(indexName) = state |> getIndex (indexName)
              member __.UpdateIndex(index) = state |> updateIndex (index)
              member __.DeleteIndex(indexName) = state |> deleteIndex (indexName)
              member __.AddIndex(index) = state |> addIndex (index)
              member __.GetAllIndex() = state |> getAllIndices
              member __.IndexExists(indexName) = 
                  succeeded <| (state.IndexFactory |> LazyFactory.exists indexName indexNotFound)
              member __.GetIndexStatus(indexName) = state.IndexFactory |> LazyFactory.getState indexName
              member __.OpenIndex(indexName) = state |> openIndex indexName
              member __.CloseIndex(indexName) = state |> closeIndex indexName
  
negative.code:     
      /// Check if a given index exists
      let indexExists (indexName) (state : T) = state.IndexFactory |> LazyFactory.exists indexName indexNotFound
      
      /// Checks if a given index exists and returns the state of the index if it exists
      let indexExists2 (indexName) (state : T) = 
          match state.IndexFactory |> LazyFactory.getState indexName with
          | Choice1Of2(state) -> ok <| state
          | Choice2Of2(_) -> fail <| IndexNotFound indexName
      
      /// Checks if a given index is online or not. If it is online then return the index writer    
      let indexOnline (indexName) (state : T) = 
          match state |> indexExists2 indexName with
          | Choice1Of2(indexState) -> 
              if indexState = IndexState.OnlineMaster then ok <| (state.IndexFactory.ObjectStore.[indexName].Value.Value)
              else fail <| IndexShouldBeOnline(indexName)
          | Choice2Of2(error) -> fail <| error
  
  module IndexService = 
      /// Returns IndexNotFound error
  