add view state api