Decrement json references in api.c to not leak memory.