specify api_version in the calls
ignore swp files
use json instead
move api calls into a function