Catch errors when sending JSON to the API
Add comments in config file for agent
Check HTTP/network errors and better read config
Implement HTTP Basic Auth in API