Updated to use better form / json handling