Modify API to generate token after signin