Server now correctly runs functions called by the client