api layer for mongo db