Emmy, as the others have said, there was almost no chance it wasn't going to get ugly. Because he's unbalanced and lashing out you have the advantage of a cool head. Use legal advice and other tools, don't engage emotionally at all, and don't try and defend yourself (waste of time). Make him scared of you for once.
I've been on the other end of an angry husband but I waited it out and he eventually got the message that I wasn't going to budge.