Profile editting functionality. Changed UserId to username in certain cases (to keep consistency).