Added permissions to rest interface and improved error handling