Add Preferences. Add separate class for server API controller.

Add Preferences. Add separate class for server API controller.