Added api methods. Refactored objects structure