fix API json error handling
Merge pull request #140 from usu/zf2.api

fix API json error handling