tyring to fix
error handling on JSON API