Crm 13072 Upgrade tests so that all api calls are required to pass

On intiating success checking on the main unit test class a number of bugs in the api/ bao/ test code revealed themselves & this was the minimum number of files I needed to touch to get back to 100%. Fixes include making getcount work properly on DAO objects, validating the 'id' field as an integer on delete actions, adding some missing delete actions other minor tweaks. Some, but not all of these I was already aware of as failing

I was able to further increase code coverage & remove another 1200 lines of code but