'/gallery/folders' in the newest version doesn't include subfolders. It probably only needs the right query parameter to do so, but that doesn't seem to be documented anywhere.