clean up pocketapi and add parsing command line for key