uses new pattern for sending response from the server