I am using the **latest** localstack docker image to test aws s3, lambda and cloudformation locally. s3 and lambda seems to be working fine but when I call cloudformation **create-stack** api it gives me a 502 BadGateway error. This is the command I am using

`aws cloudformation create-stack \
  --template-body template.yaml \
  --stack-name cfn-test \
  --parameters ParameterKey=BucketPrefix,ParameterValue=demo-bucket \
  --endpoint-url=http://localhost:4581`

This is the error I get:
`An error occurred (502) when calling the CreateStack operation (reached max retries: 4): Bad Gateway`

From docker logs I got the following error
`2019-12-31T22:12:09:ERROR:localstack.services.generic_proxy: Error forwarding request: 'str' object has no attribute 'get' Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 242, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 164, in forward_request
    modified_request = transform_template(req_data)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 83, in transform_template
    if parsed.get('Transform') == 'AWS::Serverless-2016-10-31':
AttributeError: 'str' object has no attribute 'get'`

Although, when I try the **list-stacks** api it seems to be working fine
`aws --endpoint-url=http://localhost:4581 cloudformation list-stacks`

`{
    "StackSummaries": []
}`

`2019-12-31 22:10:51,865:API: 127.0.0.1 - - [31/Dec/2019 22:10:51] "GET / HTTP/1.1" 200 -`

I could not find a solution in any of the past issues or anywhere on the internet. Please assist
EVENT_LAMBDA_INVOKE_FUNC = 'lmb.if'
EVENT_SQS_CREATE_QUEUE = 'sqs.cq'
EVENT_SQS_DELETE_QUEUE = 'sqs.dq'
EVENT_SNS_CREATE_TOPIC = 'sns.ct'
EVENT_SNS_DELETE_TOPIC = 'sns.dt'
EVENT_S3_CREATE_BUCKET = 's3.cb'
EVENT_S3_DELETE_BUCKET = 's3.db'
EVENT_STEPFUNCTIONS_CREATE_SM = 'stf.cm'
EVENT_STEPFUNCTIONS_DELETE_SM = 'stf.dm'
EVENT_APIGW_CREATE_API = 'agw.ca'
EVENT_APIGW_DELETE_API = 'agw.da'
EVENT_DYNAMODB_CREATE_TABLE = 'ddb.ct'
EVENT_DYNAMODB_DELETE_TABLE = 'ddb.dt'
EVENT_DYNAMODB_CREATE_STREAM = 'ddb.cs'
EVENT_CLOUDFORMATION_CREATE_STACK = 'clf.cs'
EVENT_ES_CREATE_DOMAIN = 'es.cd'
EVENT_ES_DELETE_DOMAIN = 'es.dd'
EVENT_FIREHOSE_CREATE_STREAM = 'fho.cs'
EVENT_FIREHOSE_DELETE_STREAM = 'fho.ds'
SENDER_THREAD = None
EVENT_QUEUE = queue.Queue()
class AnalyticsEvent(JsonObject):
    def __init__(self, **kwargs):
        self.t = kwargs.get('timestamp') or kwargs.get('t') or timestamp()
        self.m_id = kwargs.get('machine_id') or kwargs.get('m_id') or get_machine_id()
        self.p_id = kwargs.get('process_id') or kwargs.get('p_id') or get_process_id()
        self.p = kwargs.get('payload') if kwargs.get('payload') is not None else kwargs.get('p')
        self.k = kwargs.get('api_key') or kwargs.get('k') or read_api_key_safe()
        self.e_t = kwargs.get('event_type') or kwargs.get('e_t')
    def timestamp(self):