<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def api_headers_tween_factory(handler, registry):
 """This tween provides necessary API headers """


    def api_headers_tween(request):
        response = handler(request)
        set_version(request, response)
        set_req_guid(request, response)
        return response

    return api_headers_tween