add create_model middleware