files API cleanup