Fixed handling references. Rewrite of handle_request_body for input arguments.