created pullTasks() function to get all uncompleted tasks from the database.