Add automatic model serialisation