make ResponseWriter an interface, tidied up NewClient