impemented api for mongo