Exposing api and ctx in order to make advanced queries