changed mongodb api call