def METHOD_NAME(getter, setter=None, type=str, key=None):
    """
    Handle the boilerplate of getting/setting a REST JSON function.
    This function handles GET and PUT requests for different datatypes.
    Parameters:
        getter (function) -- function for getting the variable
        setter (function) -- function for setting the variable (optional)
        type (Type) -- type of the variable (int, float, str)
        key (str) -- the key to use if this is a dict
    """
    if flask.request.method == 'GET':
        value = getter()
        if key:
            value = value[key]
        response = flask.jsonify(value)
    elif flask.request.method == 'PUT':
        if setter is None:
            raise ValueError("missing 'set' function needed to complete PUT request")
        value = type(flask.request.get_json())
        if key:
            setter(**{key:value})
        else:
            setter(value)
        response = ('', http.HTTPStatus.OK)
    print(f"{flask.request.remote_addr} - - REST {flask.request.method} {flask.request.path} => {value}")
    return response