first stab at rest layer, tests still need fleshing out