import requests


def api_retrieve_category_history(category_id):
    """
    Allows the client to call "retrieve --all" method on the server side to
    retrieve the historical states of category from the ledger.
    
    Args:
        category_id (str): The uuid of the category
    
    Returns:
        type: str
        String representing JSON object which allows the client to know that
        the call was either a success or a failure.
        
    """
    response = requests.get(
                    "http://127.0.0.1:850/tp/category/history/{}" \
                    .format(category_id)
                )
    output = response.content.decode("utf-8").strip()
    
    return output