Fix statistics api

Issue #20