added integration tests and working on database functions
fixed publish and unpublish