Because of missing slash in StartsWith, get_attachments requests working just like get_attachment - creating file and putting json responce in it, instead of just returning Json responce.
if ((response != null) && ((int)response.StatusCode == 200) && (uri.StartsWith("get_attachment")))
Should be
if ((response != null) && ((int)response.StatusCode == 200) && (uri.StartsWith("get_attachment/")))
Because of missing slash in StartsWith, get_attachments requests working just like get_attachment - creating file and putting json responce in it, instead of just returning Json responce.
if ((response != null) && ((int)response.StatusCode == 200) && (uri.StartsWith("get_attachment")))
Should be
if ((response != null) && ((int)response.StatusCode == 200) && (uri.StartsWith("get_attachment/")))