refactored TaskServer to support session and model serialization