Cleanups to the api, still a long way to go.