added admin page template, removed uneccessary joins on some db queries