support listing keys and dirs with trailing slash