Fixed bug in as_json method of course model