Write json handler for request
Update views