Fixing API bugs