renaming js and adding mongodb pagination