improve api doc management, delete and re-create required dirs