- Adds register command
- Modifies get_appointment command to work with POST + adds signature
- Avoids passing config dict to functions if not necessary (passing single parameters instead)
- Moves key loading to main since most of the commands will need the keys now
- Refactors post_appointment and process_post_appointment_request to work with any post request, so it can be reused for both register and get_appointment
- Functions have been rearanged in a more logical order
- Error handling has been improved
When posting a request via requests.post the json field was dumped to json, but it shouldn't have been since requests deals with this internally. That meant that the requests made by the code didn't match proper JSON.
In line with this, the API was only parsing this type POST requests correctly, making add_appointment to fail if a proper formatted JSON was passed.
On top of that, empty appointments were not checked in the Inspector before trying to get data from them, making it crash if a JSON was posted to add_appointment not containing the `appointment` field. Unit tests for this should be added.