import json


def response(message, status_code):
    """
    Shape a valid http response from a message and status code
    """
    output = {
        'statusCode': str(status_code),
        'headers': {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Origin': '*'
        }
    }
    if message:
        output['body'] = json.dumps(message)
    return output