User Authentication, API Handling

Handles #48 as well.