Fixed request handling. Added a client for debugging purposes