Updated error-handling, added Request TimeOut, ...

* Updated error-handling
* Added Request TimeOut
* Fixed QueryPushMessageStatus call in TestServer
* Code reformating