Changed register api to return the user object with its token