Legal Endogeneity