Updated API slightly to include errors