Rewrote to mirror new Perl library. New functions and endpoints.