server: add stat handler