new serialize method for the controller