added support for mongolab and pagination