Added switch to unmarshalJSONObject