refactor show method to respond to html and json