Parse the json and handle the other cases.