passing server as argument to all callbacks