Api changes so that errors sit within the objects themselves