Write client and tests