MODE-2294: Make server side classes serializable

Adds serialization to the server side classes.