Reworked mongo api to compensate for repeated similar queries.