activity-server: reorder tasks and use handlers