If I understand correctly, this duplicate key error will return a 200 error code. It's a good idea to not return 500, but I would rather send something like a 400. According to this thread on SO that should be a 409 (conflict) error. We could then catch it in the client and give some sort of warning to the user.