cleaning up api, better tests