add a renderJson method