more work in progress code.
api fixes.