Adding observer and moved some classes to API