Added deleteFiles when removing an api
Unit tests