input: Write a function to generate an API response in Python for the provided data. The function should take a dictionary as input and return a dictionary with three keys: 'status', 'data', and 'message'. The 'status' should be 200, the 'data' should be the same as the input, and the 'message' should be "Success". If the input data is invalid, return a response with status 400 and an error message.
  
  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 input"}
  assert generate_api_response({"name": "John"}) == {"status": 200, "data": {"name": "John"}, "message": "Success"}
  assert generate_api_response(None) == {"status": 400, "data": None, "message": "Invalid input"}
output: def generate_api_response(data):
      if data is None or not isinstance(data, dict):
          return {"status": 400, "data": data, "message": "Invalid input"}
      return {"status": 200, "data": data, "message": "Success"}