Merge: lib/popcorn: replace json_error method by something more useful