Cleaned up formatting of FoundationApi and changed list_file to return a list of files instead of the json. Also added a return_dirs method