Cleaned up entity service and added javadocs