Initial API work
Fix tests