fixing api to parse json