California counts legal cost of energy crisis