Updated JSON issue and added more data checking and validation