compute-ap-statistics: updated for the api changes