Enhance API request security and type safety
- Add URL encoding for username parameter in API requests
- Add additional username format validation
- Fix Peakd badge mapping to match Badge type interface
- Add proper error handling and logging
- Add proper headers for API requests
- Add type checking for API responses
This change improves security by properly validating and encoding user input before making API requests, and ensures type safety throughout the badge handling logic.