Move decision if something is json to a helper