Rework the server code to deal with both action types