implement query task by id from DB.