How to use parse json and switch instead of data store