Handle JSON response for index action