added some functional to server
used exit() instead of _exit() for better work with opened streams & descriptors