scripts/e621: move api calls to wrapper, handle errors in results