changed jsonapicontroller to use custom cookie.