Added deinitialization procedures and api tex file