More progress on implementing the R api