adds check for savedInstanceState in activity.onCreate(), uses java objects for json instead of hashmaps, adds nullchecks for context