Basic error handling and remove URI encoding requirement