Implement authorization for API