revise files API and upload script