changing views to json responses