input: Write a function to generate an API response in Python for the provided data. The function should return a dictionary containing the status code, the data, and a message. If the input data is empty, return a dictionary with a status code of 400, an empty data field, and a message indicating that the data is invalid.
  assert generate_api_response({"name": "John", "age": 28}) == {
    "status": 200,
    "data": {"name": "John","age":28},
    "message": "Success"
  }
  assert generate_api_response({}) == {
    "status": 400,
    "data": {},
    "message": "Invalid data"
  }
output: def generate_api_response(data):
      if not data:
          return {"status": 400, "data": {}, "message": "Invalid data"}
      return {"status": 200, "data": data, "message": "Success"}