improve filter to allow json as optional format param