add login api and get_last_queries api