Added API to register a user. Fixed #1.