Registered handler as a signal function handler. Fixed code in server function. Almost fully implemented.