implements some of the basic functionality from Rails