added possibility of resolving usernames and querying user info.
Better use of exceptions.