Add activity_type_id to case_type api output

If $values is a tree (with nested elements), then (array)$values only converts the top-level. json_decode(json_encode()) walks the entire tree and converts everything.