updated respond_to for html and json formats