test object existance in method get_{ticket|user|links|queue}
test object existance for get_attachment*, get_*history methods and code cleanup

- simplify line spliting and searching for more readable code
- reveal exceptions instead of hiding them