changed implementation details for better flexibility
expose data as REST API