Moves function from client to server