todo
api fixed 'use of closed network connection'
make testing better