login page nows sends and receives json from server