fixed api.
added logs