cleaned up old api code and obsolete libraries.