returning json from resources