added network error handling, api response logging, --test output, and fixed key error with query pagination