From Ethics to Liability: Legal Challenges in the Era of Artificial Intelligence