Improves error message handler when file API calls result into an error

Jira issue: APPPARTY-59
Merge pull request #30 from eelcocramer/APPPARTY-59

Improves error message handler when file API calls result into an error