- Avoid long argument lists and only pass values that are strictly
required such as status, fill in all other fields directly instead.
- Fill OS struct in requests based on local system.
- Define event and status codes as constants.
- Misc style tweaks.