Authentication changed to return json(not html)