Adding API endpoints