implement REST api in core