Changed counters, totalPages is calculated, changed login system to external DB