implemented the mongodb queries (TODO: regexp), cleanly separated resource, service and data access