Add unit tests for ApiUser and some other missing checks
Clean up some unused, commented code
Fix indentation
Return zero results when trying to retrieve cacti instances for nonexisting ApiUser