Altered response to handle non Ajax requests and throws exception