added invalid URI or HTTP method error handling