Implement insert and upsert methods