Fixing API errors