misc changes to orig code

to get relational db working on apigee;
(not working);
wip
minor changes