Added authentication and paging, migrated to MySQL