refactor(client): check for invalid params and throw more useful errors

@vladikoff r?