passing data as json from controller