More cleanup on api