How to add REST API upsert support

Let’s add REST API upsert support – an insert statement with additional logic that ensures the new row will be updated if it already exists.