Fix method existance in a handler while handling an XHR request