making client api more general