removing spaces from json and removing arrays