Establishes an API client for one-way communication
    connection with an API Server
    
    Arguments:
        - connection (xbahn.connection.Connection)

    Keyword Arguments:
        - client_class (xbahn.api.Client): if supplied use this class to initantiate
            the client object. If omitted will use xbahn.api.Client.
    
    Returns:
        - client_class: client instance

def api_client(connection, client_class=xbahn.api.Client):
    """
    Establishes an API client for one-way communication
    connection with an API Server
    
    Arguments:
        - connection (xbahn.connection.Connection)

    Keyword Arguments:
        - client_class (xbahn.api.Client): if supplied use this class to initantiate
            the client object. If omitted will use xbahn.api.Client.
    
    Returns:
        - client_class: client instance
    """

    return client_class(
        link=xbahn.connection.link.Link(
            # use the connection receive messages (server responses)
            receive=connection,
            # use the connection to send messages (initiate requests to server)
            send=connection
        )
    )