moved the request handling to a dedicated class and made a couple of small fixes