separating apis and server functionalities from views