Fix to use server error handling
Merge pull request #7 from ionux/master

Fix to use server error handling