Getting of tasks from database