Recreated basic functionality of ActiceRecord