Improved unit tests

The unit tests now also cover the request-making part of the library, not just the response handling.