server class with stream