small changes in RestSampleController, to be a little more general (and a little more Grails-like)