setting route format type to accept and return json based on _format parameter