JSON controller for clientside JavaScript usage