Authenticate API requests

@doomspork if this looks good feel free to merge