adding authentication to API methods