build the page based on the query parameters