(maint) Abstract http requests out of individual commands

This commit abstracts the handling of http requests to a single Request
function which may be handed arbitrary json in string format. Also
improves the validation of the list command.