API primary key fix