Store tasks in database