Multiple bug-fixes, primarily for stability

The two commits included cover the 5 issues I've just raised, particularly:
* started adding validation for startATMode (more needed), 
* integer HTTP status code return types for get and post, 
* correcting Content-Length = 0 check
* adding timeout to readResponse
* disconnecting at the end of get and post