added clear space function to api