CAL-861 implemnt rest, add test cases