add client request switch and function send_response