http: tries to make client work and refactor on the server side