Implementing security API using Kotlin