Ajax edit fixed

Ajax edit is working again. The response generater function that I
added a few commits ago messed up some stuff. Update the response
generator to only json_encode the response if there is any. This fixed
the problem for single updates