Fix: encode URI components in REST API