Implement saveRecord

The saveRecord method appeared to be a broken skeleton implementation. This PR finishes it.