Changes to login api ajax refresh