Cleaner response parsing (by @svedin) and more consistent order of
arguments for a few functions.