Currently if rpc handler returns smart pointer rpc will try to serialize the pointer object as opposite to an object the ptr is pointing to. This patch fixes it by serializing real object instead of a pointer.