Subjects API and some refactor