Made API authentication work