Refactor PurpleController to look up records in db