Removing debug code with API