Add null safety checks to prevent TypeError when backend returns null
instead of empty array for files list. Initialize empty slices on backend
and add null coalescing on frontend when accessing files state.
- Backend: Initialize files slice to always return [] instead of null
- Frontend: Add null checks for files state in all map/filter operations