Implemented all API calls and command line scripts (mostly untested).