Minor bugfix. Encoded array to json twice before i echoed it.