Move prefs.py lib under 'api' subdirectory