def create_response(data, status_code, detail):
    """
    Create a standardised response
    [
        status: 'message',
        code: 'number',
        data: '{}|[]',
        detail: 'message',
    ]
    """
    response = {
        'status': 'success',
        'code': status_code,
        'data': data,
        'detail': detail
    }

    is_success = str(status_code).startswith('2') or str(status_code).startswith('3')

    if not is_success:
        response['status'] = 'error'
        response['data'] = None
        try:
            response['detail'] = data['detail']
        except KeyError:
            response['detail'] = data

    return response