input: Write a python function to fetch JSON data from a given URL and convert it into a dictionary with 'id' as the key.
  assert fetch_data("https://example.com/data") == {1: {'id': 1, 'name': 'Item 1'}, 2: {'id': 2, 'name': 'Item 2'}}
  assert fetch_data("https://example.com/anotherdata") == {10: {'id': 10, 'value': 'A'}, 20: {'id': 20, 'value': 'B'}}
output: import requests
  
  def fetch_data(url):
      response = requests.get(url)
      data = response.json()
      return {item['id']: item for item in data}