Jsonapi format for custom calls. Added an option to parse as a resource or collection