finished up category pages with their sql queries