Implemented upsert_lead method