Added posibility to return json to the user