Cleaned up api stuff.