using render json rather than respond with