updates api to test for json response and to test for sort_type in get responses