Changed the before filter to check for the format instead of a custom header