added and refactored socket mocks; implemented request handler