Fixed API, the returning of json caused the functions to exit prematurely
fixed API, returning the success json caused the function to exit prematurely