refactored most of the code; implemented API call on device.manufacturer_d_country; implemented API call on event_type