added acceptJson method and overwriteFormat property to detect JSON request