Server code cleanup; finalized API functions
Client side cleanup