change interface to make code testable
added preprocessor for users API