Refactored list_tasks to pull from DB