Phase transitions and domain structures in ester and acid monolayers