Cpp templates: Do not try to deserialize not reference object on server

Change-Id: Ifc737b03f24e52cb6fb870d5767e43f7ed843cb1