util for mongo and rest controller