make restful api work for statistics