ch('/expenses');
                if (!response.ok) throw new Error('Failed to fetch data');
                const data = await response.json();
                allExpenses = Array.isArray(data) ? data : (data && Array.isArray(data.expenses) ? data.expenses : []);

                allTags.clear();
                allExpenses.forEach(exp => {
                    if (exp.tags) {
                        exp.tags.forEach(tag => allTags.add(tag));
                    }
                });
                
       