input: Write a python function to get product names and prices from an API.
  assert get_product_names_and_prices('https://example.com/api/products') == {'Product1': 29.99, 'Product2': 49.99}
  assert get_product_names_and_prices('https://example.com/api/another_products') == {'ProductA': 19.99, 'ProductB': 39.99}
  assert get_product_names_and_prices('https://example.com/api/empty_products') == {}
output: def get_product_names_and_prices(api_url):
      import requests
      response = requests.get(api_url)
      if response.status_code != 200:
          return {}
  
      products = response.json()
      product_dict = {product['name']: product['price'] for product in products}
      return product_dict