use respond_with method instead of respond_to