update the frontend to support UPSERT feature