wrapped server into class, seems to be working