added code and test cases for api create and delete