return json with error code to mobile