Rearranged some functions, added first version of update view and api call