Refactored server. Cleaned up RPC call framework