added sort flag to getAttributes resource