Fix permissions problems with API.