implementing mongo API