CAL-861 finish rest api and test cases