added parsing json-response and changed functions