completed methods that query database