changed rest testings to json
added sorting functionality to packages controller