remove temp files and folders, finisfed base functionality for server and client