Product json api tr30

significant cleanup of api code