fix api call and finish base functions