rest-api: Update background operations

Return the metadata dict on creation and allow storing multiple related
resources.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
rest-api: Some minor fixups

 - Fix broken JSON
 - Drop result and result_code from operation, use status instead
 - Add timeout arg to operation /wait

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Merge pull request #108 from stgraber/master

rest-api: Update background operations