improvement code in api/users/<username>