Add to_dict method to base model class