Replace raw fetch() in settings, share-key, and import-shared with
centralized API handlers via src/lib/api.ts. Also auto-create the data/
directory on startup so the SQLite db path is always valid.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>