flatten server-side directory structure