Add HEAD method and fix crash