implement rest of client
fix a few situations where errors would occur