def endpoint_create(data: dict, user: str) -> dict: if "name" not in data or "country" not in data: return invalid_request name: str = data["name"] country: str = data["country"] if Profile.exists(user): return profile_already_exists Profile.create(user, name, country) return success