Fix: Return 400 when unique constraint violated and lookup fails