initial version done for stat api