I use the following code to render data in JSON format.
render(contentType:\"text/json\") { results = array { db.eachRow(query) { row ->
This should be enough to render a JSON from controller:
render results as grails.converters.JSON