Added a retrieve function for the pages.js