Added to_dict method for models
Corrected usage of model dict representation