proper error handling
Merge pull request #9 from stbarrientos/fixing-ajax

proper error handling