rest-api working with json