add head and options in restful middleware