extended stats and accounting with REST API
fixed a bug spotted by exception mail ;)