moved directory listing related stuff into a new src file (Now Api.js only contains api mappings and old streaming code);
handle errors when getDirectoryList fails;